package net.lab1024.sa.admin.module.business.oa.reservation.dao;

import java.util.List;

import jakarta.validation.Valid;
import net.lab1024.sa.admin.module.business.oa.reservation.domain.entity.ReservationEntity;
import net.lab1024.sa.admin.module.business.oa.reservation.domain.form.ReservationQueryForm;
import net.lab1024.sa.admin.module.business.oa.reservation.domain.form.ReservationQueryFormPub;
import net.lab1024.sa.admin.module.business.oa.reservation.domain.vo.ReservationVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 预约记录 Dao
 *
 * @Author TianYuan
 * @Date 2025-07-22 16:21:55
 * @Copyright TianYuan
 */

@Mapper
public interface ReservationDao extends BaseMapper<ReservationEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     *
     * @return
     */
    List<ReservationVO> queryPage(Page page,
                                  @Param("queryForm") ReservationQueryForm queryForm);

    /**
     * 更新删除状态
     */
    long updateDeleted(@Param("reservationId") Long reservationId,
                       @Param("deletedFlag") boolean deletedFlag);

    /**
     * 批量更新删除状态
     */
    void batchUpdateDeleted(@Param("idList") List<Long> idList,
                            @Param("deletedFlag") boolean deletedFlag);

    void updateReservationState(@Param("reservationId") Long reservationId,
                                @Param("reservationType") String reservationType);

    List<ReservationVO> queryPage4public(@Valid ReservationQueryFormPub queryForm);
}
